package com.we.weblog.service.impl;

import com.we.weblog.domain.Game;
import com.we.weblog.mapper.GameMapper;
import com.we.weblog.service.GameService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GameServiceImpl implements GameService{
    @Autowired
    private GameMapper gameMapper;

    @Override
    public int addGame(Game game) {
        return gameMapper.addGame(game);
    }

    @Override
    public int updateGameById(Game game) {
        return gameMapper.updateGameById(game);
    }

    @Override
    public int deleteGameById(Integer id) {
        return gameMapper.deleteGameById(id + "");
    }

    @Override
    public Game selectGameId(Integer id) {
        return gameMapper.selectGameId(id + "");
    }

    @Override
    public List<Game> selectGame() {
        return gameMapper.selectGame();
    }

    @Override
    public List<Game> selectGameByCategory(Integer categoryId) {
        return gameMapper.selectGameByCategory(categoryId +"");
    }

    @Override
    public List<Game> selectGameByTag(Integer tagId) {
        return gameMapper.selectGameByTag(tagId + "");
    }
}
